/* 基础样式 */
:root {
    --primary-color: #4a6cf7;
    --secondary-color: #6c757d;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 8px;
    --box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding: 0;
    margin: 0;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #4a6cf7, #6a11cb);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 2rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--box-shadow);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* 导航菜单 */
nav {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
    padding: 1rem;
}

nav ul {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

nav li {
    padding: 8px 20px;
    background: #eef2ff;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

nav li:hover, nav li.active {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* 文章列表 */
#article-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.article-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: auto; /* 改为 auto，让卡片自适应内容 */
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.article-image {
    height: 120px; /* 调整高度 */
    background: linear-gradient(45deg, #6a11cb, #4a6cf7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem; /* 字体略小以适配新高度 */
    font-weight: bold;
}

.article-content {
    padding: 1rem; /* 减少内边距 */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-content h2 {
    margin-bottom: 0.5rem; /* 适当减少间距 */
    font-size: 1.2rem; /* 更紧凑的标题 */
}

.article-content h2 a {
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
}

.article-content h2 a:hover {
    color: var(--primary-color);
}

.article-meta {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 15px;
}

.article-excerpt {
    margin-bottom: 1rem; /* 原为 1.5rem */
    flex-grow: 1;
    color: #555;
}

.read-more {
    display: inline-block;
    padding: 8px 20px;
    background: #eef2ff;
    color: var(--primary-color);
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    align-self: flex-start;
}

.read-more:hover {
    background: var(--primary-color);
    color: white;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    gap: 0.5rem;
}

.pagination button {
    padding: 8px 15px;
    background: #eef2ff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.pagination button:hover {
    background: var(--primary-color);
    color: white;
}

.pagination button:disabled {
    background: #ddd;
    cursor: not-allowed;
}

.pagination button.active {
    background: var(--primary-color);
    color: white;
}

/* Markdown内容样式 */
.article-detail {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2.5rem;
    margin-bottom: 3rem;
}

.article-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5rem;
}

.article-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.article-meta-large {
    color: var(--secondary-color);
    font-size: 1rem;
    display: flex;
    gap: 20px;
}

.markdown-body {
    line-height: 1.8;
    color: #444;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.markdown-body h1 {
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}

.markdown-body h2 {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3rem;
}

.markdown-body p {
    margin-bottom: 1.2rem;
}

.markdown-body a {
    color: var(--primary-color);
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

.lang {
    font-weight: bold;
}

.markdown-body code {
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
}

/* 行号与代码内容 */
.markdown-body pre {
    background: #f1f3f5;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    line-height: 1.5;
    font-size: 14px;
    border: 1px solid #ddd;
    color: #212529;
}

.markdown-body blockquote {
    border-left: 4px solid var(--primary-color);
    background: #f8f9ff;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 6px 6px 0;
}

.back-button {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: #eef2ff;
    color: var(--primary-color);
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2rem;
    border: none;
    cursor: pointer;
}

.back-button:hover {
    background: var(--primary-color);
    color: white;
}

.about-page {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.about-page h1, .about-page h2 {
    color: #333;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--secondary-color);
    border-top: 1px solid #eee;
    margin-top: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .article-image {
        height: 100px;
        font-size: 1.2rem;
    }

    .article-content {
        padding: 0.8rem;
    }

    .article-content h2 {
        font-size: 1rem;
    }
}
